package insertpackage;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import javabean.Work;

public class Insertwor extends Insert{
	public void insertDB(Work work){
        Connection conn = null;
        PreparedStatement pstmt = null;

        try {
            conn = getConnection();
            
            pstmt = conn.prepareStatement("insert into WORK values (?,?,?,?,?,?,?,?,?,?)");
            pstmt.setString(1, null);
            pstmt.setString(2, work.getWorNAME());
            pstmt.setString(3, work.getWorESTART());
            pstmt.setString(4, work.getWorEEND());
            pstmt.setString(5, work.getWorASTART());
            pstmt.setString(6, work.getWorAEND());
            pstmt.setString(7, work.getWorSTEP());
            pstmt.setString(8, work.getEmpID());
            pstmt.setInt(9, work.getProNO());
            pstmt.setInt(10, work.getWorCOUNT());
            
            pstmt.executeUpdate();
        } catch(SQLException ex) {
        
        } finally {
            if (pstmt != null) try { pstmt.close(); } catch(SQLException ex) {}
            if (conn != null) try { conn.close(); } catch(SQLException ex) {}
        }
    }
}